package com.ccy.search.controller;

import com.ccy.search.service.SearchEsModelService;
import com.ccy.search.to.SkuEsModel;
import com.gulimall.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;

/**
 * @author coder_ccy
 * @date 2022/7/21 8:58
 */

@RestController
@RequestMapping("/search/esmodel")
public class SearchEsModelController {


    @Autowired
    private SearchEsModelService searchEsModelService;


    @RequestMapping("/up")
    public R up(@RequestBody  List<SkuEsModel> skuEsModels) {

        try {
            searchEsModelService.up(skuEsModels);
            return R.ok();
        } catch (IOException e) {
            e.printStackTrace();
            return R.error();
        }

    }

    public static void main(String[] args) {

        System.out.println(111);
        System.out.println("aaa");
        System.out.println(222);
    }

}
